<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
  "http://colorer.sf.net/2003/hrc.dtd">
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">
   <type name="a51">
<!--
  Syntax highlighting for 8051 & compatible MCU's
  By Igor Yudincev <igor_yudincev@mail.ru>

  based on Z80 Assembler syntax 2.0
  By Alex Smith <thims@inbox.ru>
                <flame@baltnet.ru>
                <Alex.Kuznetsov@p9.f33.n478.z2.fidonet.org (2:478/33.9)>
-->
      <import type="def"/>

      <region name="aCommand" parent="Label"/>
      <region name="aDirective" parent="Directive"/>
      <region name="aLabel" parent="Label"/>
      <region name="aMnemoCommon" parent="Operator"/>
      <region name="aMnemoJumps" parent="Operator"/>
      <region name="aToken" parent="Label"/>
      <region name="aRegister" parent="Register"/>
      <region name="aLComment" parent="Comment"/>
      <region name="aBComment" parent="Comment"/>
      <region name="aSymbol" parent="Symbol"/>
      <region name="aString" parent="String"/>
      <region name="aNumDec" parent="NumberDec"/>
      <region name="aNumHex" parent="NumberHex"/>
      <region name="aNumBin" parent="NumberBin"/>
      <region name="aChapter" parent="Label"/>
      <region name="aTopicNum" parent="NumberHex"/>
      <region name="aTopicName" parent="String"/>
      <region name="aToDo" parent="TODO"/>


      <scheme name="BaseA51">
<!-- a51 mnemonics -->
         <keywords ignorecase="yes" region="aMnemoCommon">
           <word name="addc"/>
           <word name="add"/>
           <word name="anl"/>
           <word name="clr"/>
           <word name="cpl"/>
           <word name="da"/>
           <word name="dec"/>
           <word name="div"/>
           <word name="inc"/>
           <word name="mov"/>
           <word name="movc"/>
           <word name="movx"/>
           <word name="nop"/>
           <word name="mul"/>
           <word name="orl"/>
           <word name="pop"/>
           <word name="push"/>
           <word name="ret"/>
           <word name="reti"/>
           <word name="rl"/>
           <word name="rlc"/>
           <word name="rr"/>
           <word name="rrc"/>
           <word name="setb"/>
           <word name="subb"/>
           <word name="swap"/>
           <word name="xch"/>
           <word name="xchd"/>
           <word name="xrl"/>
         </keywords>
<!-- a51 jumps and calls -->
         <regexp match="/^\s*([A-Za-z\_]\w*\:)?\s*([AaLlSs]jmp|[AaLlSs]call|jn?[CcEeZz])\s+([A-Za-z\_]\w*)/i"
                 region1="aLabel" region2="aMnemoJumps" region3="aLabel" />
         <regexp match="/^\s*([A-Za-z\_]\w*\:)?\s*(jn?b|jbc)\s+([A-Za-z\_]\w*|\$[\da-fA-F]+|\d[0-9a-fA-F]*[hH]|[0-9]+|\%[01]+)\s*\,\s*([A-Za-z\_]\w*)/i"
                 region1="aLabel" region2="aMnemoJumps" region4="aLabel" />
         <regexp match="/^\s*([A-Za-z\_]\w*\:)?\s*(djnz)\s+(([Rr][0-7])|([A-Za-z\_]\w*|\$[\da-fA-F]+|\d[0-9a-fA-F]*[hH]|[0-9]+|\%[01]+))\s*\,\s*([A-Za-z\_]\w*)/i"
                 region1="aLabel" region2="aMnemoJumps" region4="aRegister" region6="aLabel" />
         <regexp match="/^\s*([A-Za-z\_]\w*\:)?\s*(cjne)\s+(A)\s*\,\s*([A-Za-z\_]\w*|\$[\da-fA-F]+|\d[0-9a-fA-F]*[hH]|[0-9]+|\%[01]*)\s*\,\s*([A-Za-z\_]\w*)/i"
                 region1="aLabel" region2="aMnemoJumps" region3="aRegister" region5="aLabel"/>
         <regexp match="/^\s*([A-Za-z\_]\w*\:)?\s*(cjne)\s+([Rr][0-7]|@[Rr][01]|A)\s*\,\s*(#[+\-]?([A-Za-z\_]\w*|\$[\da-fA-F]+|\d[0-9a-fA-F]*[hH]|[0-9]+|\%[01]+))\s*\,\s*([A-Za-z\_]\w*)/i"
                 region1="aLabel" region2="aMnemoJumps" region3="aRegister" region4="aNumHex" region6="aLabel"/>
         <keywords ignorecase="yes" region="aMnemoJumps">
           <word name="acall"/>
           <word name="scall"/>
           <word name="lcall"/>
           <word name="cjne"/>
           <word name="djnz"/>
           <word name="jb"/>
           <word name="jnb"/>
           <word name="jbc"/>
           <word name="jc"/>
           <word name="jnc"/>
           <word name="je"/>
           <word name="jne"/>
           <word name="jz"/>
           <word name="jnz"/>
           <word name="jmp"/>
           <word name="ajmp"/>
           <word name="sjmp"/>
           <word name="ljmp"/>
         </keywords>

         <!-- A51 registers -->
         <keywords ignorecase="yes" region="aRegister">
           <word name="R0"/><word name="R1"/><word name="R2"/>
           <word name="R3"/><word name="R4"/><word name="R5"/>
           <word name="R6"/><word name="R7"/>
           <word name="@R0"/><word name="@R1"/><word name="A"/>
           <word name="ab"/><word name="dptr"/><word name="c"/>
           <word name="@a+dptr"/><word name="@a+pc"/>
         </keywords>
      </scheme>

      <!-- TASM51 syntax -->

      <scheme name="a51">
         <inherit scheme="BaseA51"/>
         <!-- Numbers - Dec -->
         <!--regexp match="/\b\d+\B/" region0="aNumDec"/-->
         <regexp match="/\#[0-9A-Za-z_]+/" region0="aNumDec"/>
         <regexp match="/[+\-*/]([0-9A-Za-z_]+)/" region1="aNumDec"/>
         <!-- Numbers - Hex -->
         <regexp match="/\#\$[0-9a-fA-F]+/" region0="aNumHex"/>
         <regexp match="/\#\d[0-9a-fA-F]+[hH]/" region0="aNumHex"/>
         <regexp match="/[+\-*/](\$[0-9a-fA-F]+)/" region1="aNumHex"/>
         <regexp match="/[+\-*/](\d[0-9a-fA-F]+[hH])/" region1="aNumHex"/>
         <!-- Numbers - Bin -->
         <regexp match="/\#\%[01]+/" region0="aNumBin"/>
         <!-- Comments -->
         <regexp match="/;\!\!.*$/" region0="aToDo"/>
         <regexp match="/;\?\?.*$/" region0="aToDo"/>
         <regexp match="/\;.*$/" region0="aLComment"/>
         <!-- Strings -->
         <regexp match='/".*?"/' region0="aString"/>
<!-- Symbols -->
         <keywords region="aSymbol">
           <symb name="="/><symb name="+"/><symb name="-"/>
           <symb name="/"/><symb name="*"/><symb name="("/>
           <symb name=")"/><symb name="&lt;"/><symb name=">"/>
           <symb name=","/><symb name="&amp;"/><symb name="%"/>
         </keywords>
<!-- Strings -->
         <regexp match="/('.*?')/" region0="aString"/>
<!-- Operators -->
         <keywords ignorecase="yes" region="aSymbol">
            <word name="HIGH"/>
            <word name="LOW"/>
            <word name="NOT"/>
            <word name="MOD"/>
            <word name="SHL"/>
            <word name="SHR"/>
            <word name="AND"/>
            <word name="XOR"/>
            <word name="OR"/>
         </keywords>
<!-- Directives -->
         <keywords ignorecase="yes" region="aDirective">
            <word name=".BYTE"/>
            <word name=".ORG"/>
            <word name=".EQU"/>
            <word name=".END"/>
            <word name=".TEXT"/>
            <word name=".EJECT"/>
            <word name=".WORD"/>
            <word name=".LIST"/>
            <word name=".NOLIST"/>
            <word name=".PAGE"/>
            <word name=".NOPAGE"/>
            <word name=".TITLE"/>
            <word name="#ELSE"/>
            <word name="#DEFINE"/>
            <word name="#DEFCONT"/>
            <word name="#ENDIF"/>
            <word name="#IF"/>
            <word name="="/>
         </keywords>
<!-- Labels, Functions and Macroses -->
         <regexp match="/^\s*([A-Za-z\_]\w*)(\s+((.EQU)|(=)))/i"
                 region1="aNumDec" region2="Function" region4="aDirective" region5="aDirective"/>
         <regexp match="/^\s*([A-Za-z\_]\w*)(\:)|(\s+((.EQU)|(=)))/i"
                 region1="aLabel" region2="aLabel" region4="Function" region5="aDirective" region6="aDirective" region7="aDirective"/>
         <regexp match="/^\s*?(\S+)\s+?(.(BYTE|WORD))\s/i" region1="aLabel" region2="aDirective"/>
<!-- Includes -->
         <regexp match="/^\s*?(#INCLUDE)\s+?(.*$)/i" region1="aDirective" region2="aString"/>
      </scheme>
   </type>
</hrc>
<!-- ***** BEGIN LICENSE BLOCK *****
   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
   -
   - The contents of this file are subject to the Mozilla Public License Version
   - 1.1 (the "License"); you may not use this file except in compliance with
   - the License. You may obtain a copy of the License at
   - http://www.mozilla.org/MPL/
   -
   - Software distributed under the License is distributed on an "AS IS" basis,
   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   - for the specific language governing rights and limitations under the
   - License.
   -
   - The Original Code is the Colorer Library.
   -
   - The Initial Developer of the Original Code is
   - Igor Yudincev <igor_yudincev@mail.ru>.
   - Portions created by the Initial Developer are Copyright (C) 1999-2005
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either the GNU General Public License Version 2 or later (the "GPL"), or
   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   - in which case the provisions of the GPL or the LGPL are applicable instead
   - of those above. If you wish to allow use of your version of this file only
   - under the terms of either the GPL or the LGPL, and not to allow others to
   - use your version of this file under the terms of the MPL, indicate your
   - decision by deleting the provisions above and replace them with the notice
   - and other provisions required by the LGPL or the GPL. If you do not delete
   - the provisions above, a recipient may use your version of this file under
   - the terms of any one of the MPL, the GPL or the LGPL.
   -
   - ***** END LICENSE BLOCK ***** -->
